from app import app, db
from sqlalchemy import inspect

def check_database_structure():
    with app.app_context():
        inspector = inspect(db.engine)
        tables = inspector.get_table_names()
        print("数据库中的表:", tables)
        
        for table in tables:
            print(f"\n表 {table} 的列:")
            columns = inspector.get_columns(table)
            for column in columns:
                print(f"  - {column['name']}: {column['type']}")

if __name__ == '__main__':
    check_database_structure()